"""
python read_fujian4_csv.py
"""


import csv
import json

data = []

# 读取 CSV 文件
with open('../fujian/fujian4.csv') as csvfile:
    reader = csv.reader(csvfile)
    next(reader)  # 跳过第一行
    for row in reader:
        data.append({
            "category1": row[0],
            "category2": row[1],
            "association": int(row[2])
        })

# 将数据写入 JSON 文件
with open('../fujian/fujian4/origin_data.json', 'w') as jsonfile:
    json.dump(data, jsonfile, indent=4)